package 富婆梦.第一阶段.第五周.练习题;

/**
 * @ProjectName: java-learning
 * @Package: 富婆梦.第一阶段.第五周
 * @ClassName: Son
 * @Author: hemengjin
 * @Description: 验证第九章内容疑惑点，父类
 * @Date:2021/8/16 17:08
 * @Version: 1.0
 */
public class Son extends Father{
    Integer i;
    int j;
    public Son(int i){
        super(i);
        //System.out.println("这是子类的第1个构造函数！");
    }
    public Son (int x,String y){
        super(x);
        //System.out.println("这是子类的第2个构造函数！");
    }
    public String testString(){
        //String s = "a";
        String s = new String();
        return s;
    }
    public Son testSon(){
        Son s = new Son(2,"b");
        return s;
    }

    @Override
    public void testFinal2() {
        super.testFinal2();
    }



    public static void main(String[] args) {
        Son son = new Son(1,"a");
        System.out.println("testString:"+son.testString().equals(son.testString()));
        System.out.println("testSon:"+son.testSon().equals(son.testSon()));
        System.out.println("第一次调用"+son.testString());
        System.out.println("第二次调用"+son.testString());
        System.out.println("第一次调用:"+son.testSon());
        System.out.println("第二次调用:"+son.testSon());
        son.i = son.j;
        System.out.println(son.i);
        //j=i;
        //i=j;
}
}
